3.76 \(\int (e x)^{-1+n} (a+b \csc (c+d x^n))^2 \, dx\)

Optimal. Leaf size=80 \[ \frac{a^2 (e x)^n}{e n}-\frac{2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\cos \left (c+d x^n\right )\right )}{d e n}-\frac{b^2 x^{-n} (e x)^n \cot \left (c+d x^n\right )}{d e n} \]

[Out]

(a^2*(e*x)^n)/(e*n) - (2*a*b*(e*x)^n*ArcTanh[Cos[c + d*x^n]])/(d*e*n*x^n) - (b^2*(e*x)^n*Cot[c + d*x^n])/(d*e*
n*x^n)

________________________________________________________________________________________

Rubi [A]  time = 0.0924358, antiderivative size = 80, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.273, Rules used = {4209, 4205, 3773, 3770, 3767, 8} \[ \frac{a^2 (e x)^n}{e n}-\frac{2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\cos \left (c+d x^n\right )\right )}{d e n}-\frac{b^2 x^{-n} (e x)^n \cot \left (c+d x^n\right )}{d e n} \]

Antiderivative was successfully verified.

[In]

Int[(e*x)^(-1 + n)*(a + b*Csc[c + d*x^n])^2,x]

[Out]

(a^2*(e*x)^n)/(e*n) - (2*a*b*(e*x)^n*ArcTanh[Cos[c + d*x^n]])/(d*e*n*x^n) - (b^2*(e*x)^n*Cot[c + d*x^n])/(d*e*
n*x^n)

Rule 4209

Int[((a_.) + Csc[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*((e_)*(x_))^(m_.), x_Symbol] :> Dist[(e^IntPart[m]*(e*x
)^FracPart[m])/x^FracPart[m], Int[x^m*(a + b*Csc[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x]

Rule 4205

Int[((a_.) + Csc[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Csc[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[
(m + 1)/n], 0] && IntegerQ[p]

Rule 3773

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^2, x_Symbol] :> Simp[a^2*x, x] + (Dist[2*a*b, Int[Csc[c + d*x], x],
 x] + Dist[b^2, Int[Csc[c + d*x]^2, x], x]) /; FreeQ[{a, b, c, d}, x]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int (e x)^{-1+n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx &=\frac{\left (x^{-n} (e x)^n\right ) \int x^{-1+n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx}{e}\\ &=\frac{\left (x^{-n} (e x)^n\right ) \operatorname{Subst}\left (\int (a+b \csc (c+d x))^2 \, dx,x,x^n\right )}{e n}\\ &=\frac{a^2 (e x)^n}{e n}+\frac{\left (2 a b x^{-n} (e x)^n\right ) \operatorname{Subst}\left (\int \csc (c+d x) \, dx,x,x^n\right )}{e n}+\frac{\left (b^2 x^{-n} (e x)^n\right ) \operatorname{Subst}\left (\int \csc ^2(c+d x) \, dx,x,x^n\right )}{e n}\\ &=\frac{a^2 (e x)^n}{e n}-\frac{2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\cos \left (c+d x^n\right )\right )}{d e n}-\frac{\left (b^2 x^{-n} (e x)^n\right ) \operatorname{Subst}\left (\int 1 \, dx,x,\cot \left (c+d x^n\right )\right )}{d e n}\\ &=\frac{a^2 (e x)^n}{e n}-\frac{2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\cos \left (c+d x^n\right )\right )}{d e n}-\frac{b^2 x^{-n} (e x)^n \cot \left (c+d x^n\right )}{d e n}\\ \end{align*}

Mathematica [A]  time = 0.698428, size = 102, normalized size = 1.27 \[ \frac{x^{-n} (e x)^n \left (2 a \left (a c+a d x^n+2 b \log \left (\sin \left (\frac{1}{2} \left (c+d x^n\right )\right )\right )-2 b \log \left (\cos \left (\frac{1}{2} \left (c+d x^n\right )\right )\right )\right )+b^2 \tan \left (\frac{1}{2} \left (c+d x^n\right )\right )+b^2 \left (-\cot \left (\frac{1}{2} \left (c+d x^n\right )\right )\right )\right )}{2 d e n} \]

Antiderivative was successfully verified.

[In]

Integrate[(e*x)^(-1 + n)*(a + b*Csc[c + d*x^n])^2,x]

[Out]

((e*x)^n*(-(b^2*Cot[(c + d*x^n)/2]) + 2*a*(a*c + a*d*x^n - 2*b*Log[Cos[(c + d*x^n)/2]] + 2*b*Log[Sin[(c + d*x^
n)/2]]) + b^2*Tan[(c + d*x^n)/2]))/(2*d*e*n*x^n)

________________________________________________________________________________________

Maple [C]  time = 0.334, size = 275, normalized size = 3.4 \begin{align*}{\frac{{a}^{2}x}{n}{{\rm e}^{-{\frac{ \left ( -1+n \right ) \left ( i\pi \, \left ({\it csgn} \left ( iex \right ) \right ) ^{3}-i\pi \, \left ({\it csgn} \left ( iex \right ) \right ) ^{2}{\it csgn} \left ( ie \right ) -i\pi \, \left ({\it csgn} \left ( iex \right ) \right ) ^{2}{\it csgn} \left ( ix \right ) +i\pi \,{\it csgn} \left ( iex \right ){\it csgn} \left ( ie \right ){\it csgn} \left ( ix \right ) -2\,\ln \left ( e \right ) -2\,\ln \left ( x \right ) \right ) }{2}}}}}-{\frac{2\,i{b}^{2}x}{dn{x}^{n} \left ({{\rm e}^{2\,i \left ( c+d{x}^{n} \right ) }}-1 \right ) }{{\rm e}^{-{\frac{ \left ( -1+n \right ) \left ( i\pi \, \left ({\it csgn} \left ( iex \right ) \right ) ^{3}-i\pi \, \left ({\it csgn} \left ( iex \right ) \right ) ^{2}{\it csgn} \left ( ie \right ) -i\pi \, \left ({\it csgn} \left ( iex \right ) \right ) ^{2}{\it csgn} \left ( ix \right ) +i\pi \,{\it csgn} \left ( iex \right ){\it csgn} \left ( ie \right ){\it csgn} \left ( ix \right ) -2\,\ln \left ( e \right ) -2\,\ln \left ( x \right ) \right ) }{2}}}}}-4\,{\frac{ab{e}^{n}{\it Artanh} \left ({{\rm e}^{i \left ( c+d{x}^{n} \right ) }} \right ){{\rm e}^{-i/2\pi \,{\it csgn} \left ( iex \right ) \left ( -1+n \right ) \left ({\it csgn} \left ( iex \right ) -{\it csgn} \left ( ix \right ) \right ) \left ({\it csgn} \left ( iex \right ) -{\it csgn} \left ( ie \right ) \right ) }}}{ned}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x)^(-1+n)*(a+b*csc(c+d*x^n))^2,x)

[Out]

a^2/n*x*exp(-1/2*(-1+n)*(I*Pi*csgn(I*e*x)^3-I*Pi*csgn(I*e*x)^2*csgn(I*e)-I*Pi*csgn(I*e*x)^2*csgn(I*x)+I*Pi*csg
n(I*e*x)*csgn(I*e)*csgn(I*x)-2*ln(e)-2*ln(x)))-2*I*b^2*x/d/n/(x^n)/(exp(2*I*(c+d*x^n))-1)*exp(-1/2*(-1+n)*(I*P
i*csgn(I*e*x)^3-I*Pi*csgn(I*e*x)^2*csgn(I*e)-I*Pi*csgn(I*e*x)^2*csgn(I*x)+I*Pi*csgn(I*e*x)*csgn(I*e)*csgn(I*x)
-2*ln(e)-2*ln(x)))-4*a*b/n*e^n/e/d*arctanh(exp(I*(c+d*x^n)))*exp(-1/2*I*Pi*csgn(I*e*x)*(-1+n)*(csgn(I*e*x)-csg
n(I*x))*(csgn(I*e*x)-csgn(I*e)))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x)^(-1+n)*(a+b*csc(c+d*x^n))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 0.53392, size = 288, normalized size = 3.6 \begin{align*} \frac{a^{2} d e^{n - 1} x^{n} \sin \left (d x^{n} + c\right ) - a b e^{n - 1} \log \left (\frac{1}{2} \, \cos \left (d x^{n} + c\right ) + \frac{1}{2}\right ) \sin \left (d x^{n} + c\right ) + a b e^{n - 1} \log \left (-\frac{1}{2} \, \cos \left (d x^{n} + c\right ) + \frac{1}{2}\right ) \sin \left (d x^{n} + c\right ) - b^{2} e^{n - 1} \cos \left (d x^{n} + c\right )}{d n \sin \left (d x^{n} + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x)^(-1+n)*(a+b*csc(c+d*x^n))^2,x, algorithm="fricas")

[Out]

(a^2*d*e^(n - 1)*x^n*sin(d*x^n + c) - a*b*e^(n - 1)*log(1/2*cos(d*x^n + c) + 1/2)*sin(d*x^n + c) + a*b*e^(n -
1)*log(-1/2*cos(d*x^n + c) + 1/2)*sin(d*x^n + c) - b^2*e^(n - 1)*cos(d*x^n + c))/(d*n*sin(d*x^n + c))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x)**(-1+n)*(a+b*csc(c+d*x**n))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \csc \left (d x^{n} + c\right ) + a\right )}^{2} \left (e x\right )^{n - 1}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x)^(-1+n)*(a+b*csc(c+d*x^n))^2,x, algorithm="giac")

[Out]

integrate((b*csc(d*x^n + c) + a)^2*(e*x)^(n - 1), x)